<?php $this; /* @var $this \Comm\View */  ?>
<?php $this->_block('content'); ?>

<form id="form-manage-article-create" action="<?= $form_action ?>" class="form-horizontal" method="post" onsubmit="return false">


	<?php if(!empty($article['id'])) : ?>
	<div class="form-group">
		<label class="col-sm-1 control-label" for="input-title"><?= _('编辑'); ?></label>
		<div class="col-sm-11">
			<p class="form-control-static"><?= $article['id'] ?></p>
			<input type="hidden" name="id" value="<?= $article['id'] ?>" />
		</div>
	</div>
	<?php endif; ?>

	<div class="form-group">
		<label class="col-sm-1 control-label" for="input-title"><?= _('标题'); ?></label>
		<div class="col-sm-11">
			<input type="text" class="form-control" id="input-title" name="title" placeholder="<?= _('文章标题'); ?>"<?php if(!empty($article['title'])) : ?> value="<?= htmlspecialchars($article['title']) ?>"<?php endif; ?>  />
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-1 control-label" for="input_category_id"><?= _('分类'); ?></label>
		<div class="col-sm-5">
            <select class="form-control" id="input_category_id" name="category_id">
                <?php foreach($categorys as $value) : ?>
                <option value="<?= $value['id'] ?>"<?php if(!empty($article['category_id']) && $article['category_id'] == $value['id']) : ?> selected="selected"<?php endif; ?>><?= $value['name'] ?> (<?= $value['alias'] ?>)</option>
                <?php endforeach; ?>
            </select>
		</div>
	</div>
	
	<div class="form-group">
	<label class="col-sm-1 control-label" for="input_category_id"><?= _('内容'); ?></label>
    	<div class="col-sm-11">
            <textarea name="" id="input_content" rows="10" cols="80"><?php if(!empty($article['content'])) : ?><?= $article['content'] ?><?php endif; ?></textarea>
        </div>
    </div>

	<div class="form-group">
		<div class="col-sm-offset-1 col-sm-11">
			<input type="submit" class="btn btn-info" value="<?= _('发布') ?>" />
			<a href="<?= $this->path('manage/article/index') ?>" class="btn btn-default" role="button" /><?= _('返回文章列表') ?></a>
		</div>
	</div>
    
</form>
<?php $this->_blockEnd(); ?>
<?php $this->_block('body_end')?>
<?php $this->jsLib('ckeditor_js'); ?>
<?php $this->js('manage/article/update.js'); ?>

<?php $this->_blockEnd()?>
<?php $this->_blockLoad('_block/manage', ['nav'=>'article']) ?>